#include <fcntl.h>
#include <unistd.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>

int main()
{
	int fd = open("hello.txt", O_WRONLY | O_CREAT | O_TRUNC, 0644);
	if(fd < 0)
	{
		perror("open failed");
		exit(1);
	}

	const char* msg = "Hello Linux\n";
	write(fd, msg, strlen(msg));

	close(fd);
	return 0;
}
